package com.net.xpay.common.manager.impl;

import com.google.common.base.Preconditions;
import com.net.common.dao.BasicMapper;
import com.net.common.manager.AbstractManager;
import com.net.xpay.common.dao.PayTransReceiptMapper;
import com.net.xpay.common.domain.PayTransReceipt;
import com.net.xpay.common.manager.PayTransReceiptManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class PayTransReceiptManagerImpl extends AbstractManager<PayTransReceipt> implements PayTransReceiptManager{

    @Autowired
    private PayTransReceiptMapper mapper;


    @Override
    protected BasicMapper<Long, PayTransReceipt> getMapper() {
        return mapper;
    }

    @Override
    public PayTransReceipt findByPayTransId(Long userId, Long payTransId) {
        Preconditions.checkArgument(userId != null && payTransId != null);
        PayTransReceipt condition = new PayTransReceipt();
        condition.setUserId(userId);
        condition.setPayTransId(payTransId);
        return getByCondition(condition);
    }

}
